package handlers

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"zy2/doc-serve/models"
)

func List(c *gin.Context) {
	var docserves []models.DocServe
	err := models.DB.Find(&docserves).Error
	if err != nil {
		c.JSON(http.StatusOK, gin.H{
			"code": 0,
			"msg":  "查询失败",
		})
		return
	} else {
		c.JSON(http.StatusOK, gin.H{
			"code": 200,
			"msg":  "查询成功",
			"data": docserves,
		})
		return
	}
}
